﻿using System;

namespace SimpleORM
{
    public sealed class ParseException : Exception
    {
        int position;

        public ParseException(string message, int position)
            : base(message)
        {
            this.position = position;
        }

        public int Position
        {
            get { return position; }
        }

        public override string ToString()
        {
            return string.Format(Res.ParseExceptionFormat, Message, position);
        }
    }

    public class TranslateMethodException : Exception
    {
        #region Ctor

        static TranslateMethodException()
        {
            //LanguageAttribute.AddLanguage(Properties.Resources.langChs_Exception);
        }

        public TranslateMethodException(string methodName)
            : this(methodName, null)
        {
        }

        public TranslateMethodException(string methodName, Exception innerException)
            : base(methodName, innerException)
        {
        }

        #endregion
    }
    public class NotSupportedMethodException : NotSupportedException
    {
        #region Ctor

        static NotSupportedMethodException()
        {
            //LanguageAttribute.AddLanguage(Properties.Resources.langChs_Exception);
        }

        public NotSupportedMethodException(string methodName)
            : this(methodName, null)
        {
        }

        public NotSupportedMethodException(string methodName, Exception innerException)
            : base(methodName, innerException)
        {
        }

        #endregion
    }
}
